package com.xinlianshiye.im.dao;

import com.xinlianshiye.im.dao.custom.RecordDaoCustom;
import com.xinlianshiye.im.bean.Record;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface RecordDao extends JpaRepository<Record,Integer>, RecordDaoCustom {
        /**
         * @Author zw
         * @Description  删除聊天记录
         * @Date 9:56 2019/8/30
         * @Param
         **/
        Integer deleteByOwnerIdAndOtherId(Integer ownerId, Integer otherId);

        /**
         * @Author zw
         * @Description 根据接收者 和未读取 查看当前用户未读取的消息总条数
         * @Date 10:36 2020/1/8
         * @Param
         **/
        Integer countByOwnerIdAndHaveReadAndIsSender(Integer ownerId, Boolean haveRead, Boolean isSender);

        List<Record> findByOwnerIdAndOtherId(Integer ownerId, Integer otherId);
}
